require 'semantictext/tag'
require 'semantictext/tag_parsing_failed'

module SemanticText
  class FTPTag < Tag
    attr_reader :host, :path
    
    def initialize(key, value)
  		@text = value
  		@key = key
  		@path = value
  		parts = value.split '/',4
      if !(parts.size==4 && parts[0]=='' && parts[1]=='')
        raise TagParsingFailed.new("Malformed FTP tag \"#{value}\"")
      end
      
  		@host = parts[2]
  		@path = '/'+parts[3]  		
  	end
  	
  end
end